package ucn.dmf83.sc.workshop1.group3.DomainLayer;

import java.util.ArrayList;
import java.util.Iterator;

public class DVD {
	private int id;
	private String title;
	private ArrayList<String> artists;
	private String publishDate;
	
	/**
	 * @param id
	 * @param title
	 * @param artists
	 * @param publishDate
	 */
	public DVD(int id, String title, String publishDate) {
		this.id = id;
		this.title = title;
		this.publishDate = publishDate;
	}
	
	/**
	 * 
	 */
	public DVD() {
	}



	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public ArrayList<String> getArtists() {
		return artists;
	}
	
	public boolean hasArtist(String artist) {
		boolean hasArtist = false;
		for(Iterator<String> it = artists.iterator(); it.hasNext();)
		{
			if(it.next().equals(artist))
				hasArtist = true;
		}
		return hasArtist;
	}
	
	public void addArtist(String artist) {
		if(!this.hasArtist(artist))
		{
			artists.add(artist);
		}
	}
	
	
	public String getPublishDate() {
		return publishDate;
	}
	
	public void setPublishDate(String publishDate) {
		this.publishDate = publishDate;
	}
	
	
}
